#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QPushButton>
#include <QTextEdit>
#include <QLabel>
#include <QTextCodec>

#include <QDebug>

#include "com_thread.h"
#include "win_qextserialport.h"
//#include "qextserialenumerator.h"
#include "qextserialport.h"

namespace Ui {
class MainWindow;
}

class com_thread;
class QextSerialPort;

class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    QPushButton *PButton_001 ;
    QTextEdit *TEdit_001 ;
    QLabel *QLabel_001;//for the title

    bool fd_flag;
    bool timeout_flag;
    char recv_buff[1024];
    int recv_num;
    int recv_ptr;
    com_thread *com_thread_001;


    QextSerialPort *port_001;

    void new_object(void);
    void detect_uart(void);
    void default_set(void);
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    
private:
    Ui::MainWindow *ui;

private slots:
    void read_uart_data(void);
    void dispose_uart_data(void);

};

#endif // MAINWINDOW_H
